<?php 
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomFg
* @subpackage Input
*/
class DomFgDate extends DomFgTextField {
	
	protected $value;
	
//	protected $format = 'd-m-Y';
	
//	protected $calendarFormat = 'dd-MM-yyyy';
	
	public function value( $value ) {
		$f  = explode('-', $value );
		if( $f[0] == '0000' && $f[1] == '00' && $f[2] == '00') {
			$this->value = '';
		} else if( $f[1] == '00' && $f[2] == '00' ) {
			$this->value = $f[0];
		} else {
			$this->value = $value;
		}
		return $this;
	}
	
	public function render() {
		if( $this->id == NULL ) $this->id = $this->name;
			
		$renderer = $this->getRenderer();
		$renderer->assign('input', $this );
		return $renderer->fetch('Input/Date.html');
	}
	

}
?>